﻿using System.Diagnostics;

namespace ResultCollector
{
    internal class SimulationExecutable : IDisposable
    {
        private readonly Process process;
        public SimulationExecutable(string baseDir)
        {
            const string settingsPath = "CylindricalDice.exe";
            process = new Process();
            process.StartInfo.FileName = Path.GetFullPath(settingsPath, baseDir);
        }

        public void Dispose()
        {
            process?.Dispose();
        }

        public bool Start()
        {
            return process.Start();
        }

        public void Stop()
        {
            process.Kill(true);
        }
    }
}
